<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/wo ', function () {
//     return view('welcome');
// });
// Route::get('/',function(){
// 	return view('LifeandController');
// });

// //读取相关配置
// Route::get('/config',function(){
// 	echo Config::get('app.key');

// 	Config::set('app.timezone','Japen');
// })

// Route::get('/kaka/{id}',function($id){
// 	echo '来自卡卡的'.$id.'编号';
// })
// //读取环境配置 路由 get就是读取
// Route::get('./env',function(){
// 	//env function
// 	echo env('APP_KEY');
// });

// //限制参数类型
// Route::get('/param/{name}',function($name){
// 	return $name;
// })->where('name','[a-z]+');

// //传递多个参数
// Route::get('/getParames/{name}/{age}/{aaa}',function($name,$age,$aaa){
// 	echo $request->route('name');
// 	echo $request->route('id');
// });
//所有配置都经过路由文件 
//读取相关配置 临时设置配置
//Route::get('config',function(){
// 	echo Config::get('app.timezone');
// 	//dd (Config::get('app.aliases'));
// 	//dd (Config::get('env.DB_HOST'));
// 	Config::set('app.locale','japan');
// 	//dd (Config::get('app.locale'));
// 	// dd('Config');
// });

// //获取环境变量
// Route::get('env',function(){
// 	echo '本地IP：';
// 	//env('DB_HOST',127);
// 	echo  $localhost = env('DB_HOST');

// });

// //基本路由
// Route::get('nn',function(){
// 	echo '问一个奇怪的问题~';
// 	echo '你是妹控吗！';
// });

// Route::post('post',function(Request $request){
// 	echo '那么我就把这个秘密告诉你 ';
// 	//dd($request);
// 	//dd($request->all());
// 	//echo $request->input('name');
// 	// echo $a->input('name');
// 	// dd($request->has('name'));

// });
// Route::get('post',function(Request $request){
// 	echo 'xxxx';
// });

// Route::get('get',function(){
// 	//echo '<meta name="csrf-token" content="{{ csrf_token() }}">';
// 	echo '<form action="post" method="get">';
// 	// echo csrf_filed();
// 	echo csrf_field();
// 	echo '<input type="text" name="name" value="kaka" />';
// 	echo '<button type="submit">submit</button>';
// 	echo '</form>';
// });

// //带参数的路由
// Route::get('/form/{name}',function($name){
// 	echo $name;
// });

// //限制参数的类型->where('name','正则表达式');
// Route::get('/param/{name?}',function($name){
// 	return $name;
// })->where('name','[a-z]+');

// //传递多个参数
// Route::get('/getParams/{name}-{id}',function($name,$id){
// 	// echo $request->route('name');
// 	// echo $request->route('id');
// 	echo $name;
// 	echo $id;
// });

// //路由别名
// Route::get('Home/Goods/show/{id}',['as'=>'goods',function($id){
// 	echo $id.'<br>';
// 	//创建一个新的url
// 	echo url('/param/haha').'<br>';
// 	//路由别名创建url
// 	echo route('goods',['id'=>11]).'<br>';
// 	//实现页面跳转
// 	//return redirect()->route('goods',['id'=>12]);
// 	//return redirect()->route('/param/haha');
// 	// return redirect('/param/hha');
// 	return Route::currentRoutename();
// }]);

// //组前缀 ['prefix'=>'admin']
// Route::group(['prefix'=>'admin'],function(){
// 	// Route::get('404',function(){
// 	// 	abort(404,'木有找到相关的页面哦');
// 	// });
// 	route::get('kaka',function(){
// 		echo 'success';
// 	});
// 	//abort 自动调用模板
// 	route::get('/nbstring',function(){
// 		abort(503);
// 	});
// });

// //'prefix'=>'Home'
// //Route::group([],function(){

// 	//模拟设置ajax传值
// 	Route::post('ajaxxx',function(){
// 		echo 'ajax返回成功';
// 	});
// 	Route::get('/getAjax',function(){
// 		return view('getAjax');
// 	});
// //});

//后台路由组
//为路由组添加中间件的方法
// route::group(['prefix'=>'admin'],function(){
	
// 	route::get('/userManage',function(){
// 		echo '后台用户管理界面';
// 	})->middleware('Test');

// 	route::get('/goodsManage',function(){
// 		echo '后台商品管理页面';
// 	});

// 	route::get('/orderManage',function(){
// 		echo  '后台订单管理页面';
// 	});

// 	route::get('/articleManage',function(){
// 		echo '后台文章管理页面';
// 	});

// 	//404页面提示
// 	Route::get('/404',function(){
// 		abort('404');
// 	});

// });
//登陆的路由
//Route::get('/login','LoginController@Login');
//注册的路由
//Route::get('/register','LoginController@Register');
//主页的路由
// Route::get('/','GoodsController@Index');
// //商品页的路由
// Route::get('/goods','GoodsController@Goods');
// //商品详情页的路由
// Route::get('/goodsDetail','GoodsController@GoodsDetail');
// //购物车的路由
// Route::get('/shoppingCar','ShoppingCarController@ShoppingCar');
// //订单页的路由
// Route::get('/orderPage','OrderController@OrderPage');
// //用户中心的路由
// Route::get('/vipCenter','VipCenterController@VipCenter');
// // 认证路由...
// Route::get('login', 'Auth\AuthController@getLogin');
// Route::post('login', 'Auth\AuthController@postLogin');
// Route::get('logout', 'Auth\AuthController@getLogout');
// // 注册路由...
// Route::get('register', 'Auth\AuthController@getRegister');
// Route::post('register', 'Auth\AuthController@postRegister');

// //跳转路由。。。
// Route::get('profile','Auth\UserController@profile');



// //后台管理的路由
// Route::get('/admin/index','Admin\IndexController@index');

// //后台用户的路由
// Route::get('/admin/add','Admin\UserController@add');
// //用户执行的路由
// Route::post('/admin/insert','Admin\UserController@insert');
// //用户上传文件的路由
// Route::get('/admin/fileupload','Admin\UserController@fileUpload');
// Route::post('/admin/dofileupload','Admin\UserController@dofileUpload');

// //响应的路由
// Route::get('/response/str','ResponseController@str');
// //响应模板路由
// Route::get('/response/tpl',['as' =>'ttppll','uses'=>'ResponseController@tpl']);
// //响应json
// Route::get('/response/json','ResponseController@json');
// //响应下载
// Route::get('/response/download','ResponseController@download');
// //响应重定向路由
// Route::get('/response/redirect','ResponseController@redirect');

// //=================模板路由====================
// Route::get('/blade/root','BladeController@root');
// Route::get('/blade/dir','BladeController@dir');
// //分配数据
// Route::get('/blade/assign','BladeController@assign');
// //继承操作
// Route::get('/blade/drop','BladeController@drop');
// Route::get('/blade/extends','BladeController@extendsTpl');

// //================数据库操作路由===============
// Route::get('/database/index','DatabaseController@index');
// Route::get('/database/select','DatabaseController@select');
// Route::get('/database/insert','DatabaseController@insert');
// Route::get('/database/update','DatabaseController@update');
// Route::get('/database/delete','DatabaseController@delete');
// Route::get('/database/trans','DatabaseController@trans');

// Route::get('/database/insertone','DatabaseController@insertone');
// Route::get('/database/insertmore','DatabaseController@insertMore');
// Route::get('/database/qbupdate','DatabaseController@QBupdate');
// Route::get('/database/qbdelete','DatabaseController@QBdelete');
// Route::get('/database/qbgetone','DatabaseController@QBselect');
// Route::get('/database/qbselectstr','DatabaseController@QBselectStr');
// Route::get('/database/getselect','DatabaseController@getSelect');
// //排序路由
// Route::get('/database/getorder','DatabaseController@getOrder');
// //分页路由
// Route::get('/database/getpage','DatabaseController@getPage');
// //联合查询
// Route::get('/database/join','DatabaseController@join');



// //链接其他数据库
// Route::get('/database/anotherdb','DatabaseController@anotherdb');


// //后台商品增加的路由
// Route::get('/admin/goodslist','Admin\GoodsController@goodsList');
// Route::get('/admin/goods/add','Admin\GoodsController@goodAdd');
// Route::get('/admin/goods/updata','Admin\GoodsController@goodsUpdata');

// //测试访问控制器的路由
// Route::get('test/index','testController@index');
// Route::get('test/show/{id}','testController@show');
// Route::get('test/store',['as'=>'demo' ,'uses'=>'testController@store']);
// Route::get('test/create',['as'=>'xxxx','uses'=>'testController@create']);

// Route::get('test/request','testController@request');
// Route::get('test/flash','testController@flash');
// Route::get('test/old','testController@old');
// Route::get('test/getCookie','testController@getCookie');
// Route::get('test/getAddCookie','testController@getAddCookie');
// Route::get('test/fileupload','testController@fileupload');

// Route::get('/cookie/set','testController@setCookie');
// Route::get('/cookie/get','testController@getCookie');


//=======================前台首页=========================
Route::get('/','Home\IndexController@Index');

//商品详情页路由
Route::get('goodsDetaile/{id}','Home\GoodsController@goodsDetaile');

//购物车路由
Route::post('/shoppingCar','Home\ShoppingCarController@shoppingCar');
Route::get('/getshoppingCar','Home\ShoppingCarController@getshoppingCar');

//删除购物车信息
Route::get('/delshopping/{id}','Home\ShoppingCarController@delshopping');

//订单信息
Route::post('order','Home\OrderController@order');





//=======================后台登陆路由======================
Route::get('/admin/login','Admin\LoginController@Login');
Route::post('/admin/dologin','Admin\LoginController@doLogin');

//=======================后台主页=======================
Route::get('/admin/index','Admin\IndexController@index');
//后台商品列表
Route::get('/admin/goodslist','Admin\GoodsController@goodsList');
//后台商品添加
Route::get('/admin/goodsadd','Admin\GoodsController@goodsAdd');
Route::post('/admin/goodsinsert','Admin\GoodsController@goodsInsert');
//后台商品修改
Route::get('/admin/goodsupdate/{gid}','Admin\GoodsController@goodsUpdate');
Route::post('/admin/dogoodsupdate/','Admin\GoodsController@goodsDoUpdate');
//后台商品删除
Route::get('/admin/goodsdelete/{gid}','Admin\GoodsController@goodsDelete');
//后台商品搜索
Route::post('/admin/goodsSelect/','Admin\GoodsController@goodsSelect');
Route::get('/admin/goodsSelect/','Admin\GoodsController@goodsSelect');


//后台播放器管理
Route::get('/admin/player','Admin\PlayerController@playerlist');
//后台播放器搜索
Route::post('/admin/playerSelect/','Admin\PlayerController@playerSelect');
Route::get('/admin/playerSelect/','Admin\PlayerController@playerSelect');

//后台播放器添加
Route::get('/admin/playeradd','Admin\PlayerController@playerAdd');
Route::post('/admin/playerInsert','Admin\PlayerController@playerInsert');

//后台播放器修改
Route::get('/admin/playerUpdate/{id}','Admin\PlayerController@playerUpdate');
Route::post('/admin/doplayerUpdate/','Admin\PlayerController@doPlayerUpdate');

//后台播放器回收站
Route::get('/admin/playerRecycle/{id}','Admin\PlayerController@playerRecycle');
Route::get('/admin/Recycle/','Admin\PlayerController@Recycle');


